﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kaixin.Components.InterFace;
using ComponentFactory.Krypton.Toolkit;
using Kaixin.Components.XML;
using Kaixin.Components.DTO;

namespace Kaixin.Components.Tycoon.PanelFactory
{
    class OrdersUIFactory:IUIPanelFactory
    {

        #region private
        private UserSet _us = new UserSet();

        private KryptonPanel ktpanel;
        private KryptonGroupBox kryptonGroupBox1;
        private KryptonDataGridView dgvOrders;
        private KryptonLabel kryptonLabel1;
        private KryptonLabel kryptonLabel2;
        private KryptonTextBox txtConditionsPrice;
        private KryptonComboBox cbxConditions;
        private KryptonButton btnCreateDefaultOrders;
        private KryptonButton btnViewAllOrders;
        private KryptonBorderEdge kryptonBorderEdge1;
        private KryptonButton btnViewAllGoods;
        private KryptonLabel kryptonLabel3;
        private KryptonLabel kryptonLabel5;
        private KryptonTextBox txtSellPrice;
        private KryptonLabel kryptonLabel6;
        private KryptonLabel kryptonLabel4;
        private KryptonTextBox txtBuyPrice;
        private KryptonLabel kryptonLabel7;
        private KryptonLabel kryptonLabel8;
        private KryptonTextBox txtGoodsID;
        private KryptonLabel lblGoodsName;
        private KryptonLabel kryptonLabel9;
        private KryptonComboBox cbxEmails;
        private KryptonButton btnSaveOrder;

        #endregion

        #region IUIPanelFactory 成员

        public System.Windows.Forms.Panel CreatePanel()
        {
            InitializeComponent();

            cbxConditions.SelectedIndex = 0;
            List<User> list = _us.GetAllItem();
            list.Insert(0, new User("全部", "全部"));
            cbxEmails.DataSource = list;
            cbxEmails.DisplayMember = "Email";
            cbxEmails.ValueMember = "Password";

            return ktpanel;
        }

        #endregion

        private void InitializeComponent()
        {
            this.ktpanel = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
            this.kryptonGroupBox1 = new ComponentFactory.Krypton.Toolkit.KryptonGroupBox();
            this.dgvOrders = new ComponentFactory.Krypton.Toolkit.KryptonDataGridView();
            this.kryptonLabel1 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
            this.cbxConditions = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
            this.txtConditionsPrice = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
            this.kryptonLabel2 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
            this.btnCreateDefaultOrders = new ComponentFactory.Krypton.Toolkit.KryptonButton();
            this.btnViewAllOrders = new ComponentFactory.Krypton.Toolkit.KryptonButton();
            this.kryptonBorderEdge1 = new ComponentFactory.Krypton.Toolkit.KryptonBorderEdge();
            this.btnViewAllGoods = new ComponentFactory.Krypton.Toolkit.KryptonButton();
            this.kryptonLabel3 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
            this.txtBuyPrice = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
            this.kryptonLabel4 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
            this.kryptonLabel5 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
            this.txtSellPrice = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
            this.kryptonLabel6 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
            this.kryptonLabel7 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
            this.txtGoodsID = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
            this.kryptonLabel8 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
            this.lblGoodsName = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
            this.cbxEmails = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
            this.kryptonLabel9 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
            this.btnSaveOrder = new ComponentFactory.Krypton.Toolkit.KryptonButton();
            // 
            // ktpanel
            // 
            this.ktpanel.Controls.Add(this.dgvOrders);
            this.ktpanel.Controls.Add(this.kryptonGroupBox1);
            this.ktpanel.Dock = System.Windows.Forms.DockStyle.Fill;
            this.ktpanel.Location = new System.Drawing.Point(0, 0);
            this.ktpanel.Name = "ktpanel";
            this.ktpanel.Size = new System.Drawing.Size(992, 568);
            this.ktpanel.TabIndex = 0;
            // 
            // kryptonGroupBox1
            // 
            this.kryptonGroupBox1.Dock = System.Windows.Forms.DockStyle.Top;
            this.kryptonGroupBox1.Location = new System.Drawing.Point(0, 0);
            this.kryptonGroupBox1.Name = "kryptonGroupBox1";
            // 
            // kryptonGroupBox1.Panel
            // 
            this.kryptonGroupBox1.Panel.Controls.Add(this.btnViewAllGoods);
            this.kryptonGroupBox1.Panel.Controls.Add(this.btnSaveOrder);
            this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonLabel9);
            this.kryptonGroupBox1.Panel.Controls.Add(this.cbxEmails);
            this.kryptonGroupBox1.Panel.Controls.Add(this.lblGoodsName);
            this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonLabel8);
            this.kryptonGroupBox1.Panel.Controls.Add(this.txtGoodsID);
            this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonLabel7);
            this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonLabel5);
            this.kryptonGroupBox1.Panel.Controls.Add(this.txtSellPrice);
            this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonLabel6);
            this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonLabel4);
            this.kryptonGroupBox1.Panel.Controls.Add(this.txtBuyPrice);
            this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonLabel3);
            this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonBorderEdge1);
            this.kryptonGroupBox1.Panel.Controls.Add(this.btnViewAllOrders);
            this.kryptonGroupBox1.Panel.Controls.Add(this.btnCreateDefaultOrders);
            this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonLabel2);
            this.kryptonGroupBox1.Panel.Controls.Add(this.txtConditionsPrice);
            this.kryptonGroupBox1.Panel.Controls.Add(this.cbxConditions);
            this.kryptonGroupBox1.Panel.Controls.Add(this.kryptonLabel1);
            this.kryptonGroupBox1.Size = new System.Drawing.Size(992, 107);
            this.kryptonGroupBox1.TabIndex = 0;
            this.kryptonGroupBox1.Text = "委托单";
            this.kryptonGroupBox1.Values.Heading = "委托单";
            // 
            // dgvOrders
            // 
            this.dgvOrders.Dock = System.Windows.Forms.DockStyle.Fill;
            this.dgvOrders.Location = new System.Drawing.Point(0, 107);
            this.dgvOrders.Name = "dgvOrders";
            this.dgvOrders.RowTemplate.Height = 23;
            this.dgvOrders.Size = new System.Drawing.Size(992, 461);
            this.dgvOrders.TabIndex = 1;
            // 
            // kryptonLabel1
            // 
            this.kryptonLabel1.Location = new System.Drawing.Point(10, 19);
            this.kryptonLabel1.Name = "kryptonLabel1";
            this.kryptonLabel1.Size = new System.Drawing.Size(80, 18);
            this.kryptonLabel1.TabIndex = 0;
            this.kryptonLabel1.Values.Text = "最小物品价格";
            // 
            // cbxConditions
            // 
            this.cbxConditions.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbxConditions.DropDownWidth = 73;
            this.cbxConditions.Items.AddRange(new object[] {
            "大于",
            "小于"});
            this.cbxConditions.Location = new System.Drawing.Point(96, 16);
            this.cbxConditions.Name = "cbxConditions";
            this.cbxConditions.Size = new System.Drawing.Size(73, 21);
            this.cbxConditions.TabIndex = 1;
            // 
            // txtConditionsPrice
            // 
            this.txtConditionsPrice.Location = new System.Drawing.Point(175, 16);
            this.txtConditionsPrice.Name = "txtConditionsPrice";
            this.txtConditionsPrice.Size = new System.Drawing.Size(49, 21);
            this.txtConditionsPrice.TabIndex = 2;
            this.txtConditionsPrice.Text = "100";
            // 
            // kryptonLabel2
            // 
            this.kryptonLabel2.Location = new System.Drawing.Point(230, 16);
            this.kryptonLabel2.Name = "kryptonLabel2";
            this.kryptonLabel2.Size = new System.Drawing.Size(33, 18);
            this.kryptonLabel2.TabIndex = 3;
            this.kryptonLabel2.Values.Text = "万元";
            // 
            // btnCreateDefaultOrders
            // 
            this.btnCreateDefaultOrders.Location = new System.Drawing.Point(10, 43);
            this.btnCreateDefaultOrders.Name = "btnCreateDefaultOrders";
            this.btnCreateDefaultOrders.Size = new System.Drawing.Size(115, 25);
            this.btnCreateDefaultOrders.TabIndex = 4;
            this.btnCreateDefaultOrders.Values.Text = "创建默认委托单";
            // 
            // btnViewAllOrders
            // 
            this.btnViewAllOrders.Location = new System.Drawing.Point(131, 43);
            this.btnViewAllOrders.Name = "btnViewAllOrders";
            this.btnViewAllOrders.Size = new System.Drawing.Size(157, 25);
            this.btnViewAllOrders.TabIndex = 5;
            this.btnViewAllOrders.Values.Text = "查看被监控用户委托单";
            // 
            // kryptonBorderEdge1
            // 
            this.kryptonBorderEdge1.AutoSize = false;
            this.kryptonBorderEdge1.Location = new System.Drawing.Point(490, -8);
            this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
            this.kryptonBorderEdge1.Size = new System.Drawing.Size(10, 95);
            this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
            // 
            // btnViewAllGoods
            // 
            this.btnViewAllGoods.Location = new System.Drawing.Point(506, 3);
            this.btnViewAllGoods.Name = "btnViewAllGoods";
            this.btnViewAllGoods.Size = new System.Drawing.Size(88, 78);
            this.btnViewAllGoods.TabIndex = 6;
            this.btnViewAllGoods.Values.Text = "查看所有物品";
            // 
            // kryptonLabel3
            // 
            this.kryptonLabel3.Location = new System.Drawing.Point(591, 16);
            this.kryptonLabel3.Name = "kryptonLabel3";
            this.kryptonLabel3.Size = new System.Drawing.Size(57, 18);
            this.kryptonLabel3.TabIndex = 7;
            this.kryptonLabel3.Values.Text = "买入价格";
            // 
            // txtBuyPrice
            // 
            this.txtBuyPrice.Location = new System.Drawing.Point(654, 13);
            this.txtBuyPrice.Name = "txtBuyPrice";
            this.txtBuyPrice.Size = new System.Drawing.Size(49, 21);
            this.txtBuyPrice.TabIndex = 8;
            this.txtBuyPrice.Text = "0";
            // 
            // kryptonLabel4
            // 
            this.kryptonLabel4.Location = new System.Drawing.Point(709, 16);
            this.kryptonLabel4.Name = "kryptonLabel4";
            this.kryptonLabel4.Size = new System.Drawing.Size(33, 18);
            this.kryptonLabel4.TabIndex = 9;
            this.kryptonLabel4.Values.Text = "万元";
            // 
            // kryptonLabel5
            // 
            this.kryptonLabel5.Location = new System.Drawing.Point(709, 43);
            this.kryptonLabel5.Name = "kryptonLabel5";
            this.kryptonLabel5.Size = new System.Drawing.Size(33, 18);
            this.kryptonLabel5.TabIndex = 12;
            this.kryptonLabel5.Values.Text = "万元";
            // 
            // txtSellPrice
            // 
            this.txtSellPrice.Location = new System.Drawing.Point(654, 40);
            this.txtSellPrice.Name = "txtSellPrice";
            this.txtSellPrice.Size = new System.Drawing.Size(49, 21);
            this.txtSellPrice.TabIndex = 11;
            this.txtSellPrice.Text = "0";
            // 
            // kryptonLabel6
            // 
            this.kryptonLabel6.Location = new System.Drawing.Point(591, 43);
            this.kryptonLabel6.Name = "kryptonLabel6";
            this.kryptonLabel6.Size = new System.Drawing.Size(57, 18);
            this.kryptonLabel6.TabIndex = 10;
            this.kryptonLabel6.Values.Text = "卖出价格";
            // 
            // kryptonLabel7
            // 
            this.kryptonLabel7.Location = new System.Drawing.Point(778, 13);
            this.kryptonLabel7.Name = "kryptonLabel7";
            this.kryptonLabel7.Size = new System.Drawing.Size(67, 18);
            this.kryptonLabel7.TabIndex = 13;
            this.kryptonLabel7.Values.Text = "委托物品ID";
            // 
            // txtGoodsID
            // 
            this.txtGoodsID.Location = new System.Drawing.Point(851, 13);
            this.txtGoodsID.Name = "txtGoodsID";
            this.txtGoodsID.Size = new System.Drawing.Size(49, 21);
            this.txtGoodsID.TabIndex = 14;
            this.txtGoodsID.Text = "0";
            // 
            // kryptonLabel8
            // 
            this.kryptonLabel8.Location = new System.Drawing.Point(765, 40);
            this.kryptonLabel8.Name = "kryptonLabel8";
            this.kryptonLabel8.Size = new System.Drawing.Size(80, 18);
            this.kryptonLabel8.TabIndex = 15;
            this.kryptonLabel8.Values.Text = "委托物品名称";
            // 
            // lblGoodsName
            // 
            this.lblGoodsName.Location = new System.Drawing.Point(851, 40);
            this.lblGoodsName.Name = "lblGoodsName";
            this.lblGoodsName.Size = new System.Drawing.Size(80, 18);
            this.lblGoodsName.TabIndex = 16;
            this.lblGoodsName.Values.Text = "委托物品名称";
            // 
            // cbxEmails
            // 
            this.cbxEmails.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbxEmails.DropDownWidth = 121;
            this.cbxEmails.Location = new System.Drawing.Point(359, 16);
            this.cbxEmails.Name = "cbxEmails";
            this.cbxEmails.Size = new System.Drawing.Size(121, 21);
            this.cbxEmails.TabIndex = 17;
            // 
            // kryptonLabel9
            // 
            this.kryptonLabel9.Location = new System.Drawing.Point(285, 16);
            this.kryptonLabel9.Name = "kryptonLabel9";
            this.kryptonLabel9.Size = new System.Drawing.Size(68, 18);
            this.kryptonLabel9.TabIndex = 18;
            this.kryptonLabel9.Values.Text = "被监控用户";
            // 
            // btnSaveOrder
            // 
            this.btnSaveOrder.Location = new System.Drawing.Point(765, 57);
            this.btnSaveOrder.Name = "btnSaveOrder";
            this.btnSaveOrder.Size = new System.Drawing.Size(213, 25);
            this.btnSaveOrder.TabIndex = 19;
            this.btnSaveOrder.Values.Text = "保存委托单";

        }
    }
}
